<?php

// 4/10/2010: immanuel192 write this action

if (!defined('EXPONENT')) exit('');

$song_id = -1; 

// test song id
if (isset($_GET['id']))
{
	$_GET['id']=intval($_GET['id']);
	$song_id=$_GET['id'];
	$object = $db->selectObject('present_songs','id='.intval($_GET['id']));
	if (!$object) die("ERROR");
	//
	$playlist=exponent_sessions_getTicketString();
	$pl=$db->selectObject('present_playlist','session = "' . $playlist .'"');
	if ($pl==null)
	{
		$pl=null; $pl->session=$playlist; $pl->create_time=$time;
		$pl->id=$db->insertObject($pl,"present_playlist");
	}
	$db->delete("present_playlist_songs","song_id = {$song_id} AND playlist_id = {$pl->id}");
	die($song_id."OK");
}
else
 die("ERROR");


?>
